﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using Scheduling.Models.Extensions;

namespace Scheduling.Models.Helpers
{
    public class ValidationHelper
    {
        public static bool IntValidator(string StringValue,int min, int max, out int Value)
        {

            bool ok;
            Value = 0;
            if (min > max)
            {
                return false;
            }
            int result;
            ok = Int32.TryParse(StringValue,out result);
            if (ok == true && result>=min && result <=max)
            {
                Value = result;
                return true; 
            }
            return false;
        }

    }

}